<%@ page import="java.text.SimpleDateFormat" %>
<div style="font-size:x-small;">
  <p align="center">
    家乐福春城柯达店
    <br>
    交易凭据
  </p>
  <br>
  交易日期:${new SimpleDateFormat('yyyy-MM-dd HH:mm:ss').format(jobInstance?.date)}
  <br>
  <hr>
  交易号:${jobInstance.id}
  <br>
  交易项目列表:
  <br>
  <table border="0" style="font-size:x-small;width: 48mm;">
    <thead>

    <th width="5%"/>
    <th>交易项目</th>
    <th width="15%">价格</th>
    <th width="15%">数量</th>
    <th width="15%">金额</th>
    </thead>

    <tbody>
    <g:each in="${jobInstance.jobItems}" var="jobItem" status="i">
      <tr>
        <td>${i + 1}</td>
        <td>${jobItem.product.name}</td>
        <td>${jobItem.price}</td>
        <td>${jobItem.quantity}</td>
        <td>${jobItem.value}</td>
      </tr>
    </g:each>
    <tr>
      <td colspan="4" align="right">折扣前金额:</td>
      <td>${jobInstance.originalValue}</td>
    </tr>
    <tr>
      <td colspan="4" align="right">折扣:</td>
      <td>${jobInstance.discount}</td>
    </tr>
    <tr>
      <td colspan="4" align="right">折扣后金额:</td>
      <td>${jobInstance.value}</td>
    </tr>
    <tr>
      <td colspan="4" align="right">交易金额:</td>
      <td style="font:bold;">${jobInstance.actualValue}</td>
    </tr>
    </tbody>
  </table>

  <table border="0" style="font-size:x-small;width: 48mm;">
    <tr>
      <td style="width:65px">用户名:</td>
      <td style="font:bold;">${jobInstance.customer.name}</td>
    </tr>

    <tr>
      <td style="width:65px">会员卡号:</td>
      <td style="font:bold;">${jobInstance.customer.cardNumber}</td>
    </tr>

    <tr>
      <td style="width:65px">用户余额:</td>
      <td style="font:bold;">${jobInstance.customer.balance}</td>
    </tr>

    <tr>
      <td style="width:65px">用户积分:</td>
      <td style="font:bold;">${jobInstance.customer.point}</td>
    </tr>
  </table>

  <br>
  打印日期:${new SimpleDateFormat('yyyy-MM-dd HH:mm:ss').format(new Date())}
  <br>
  前台电话：0431-87966978
  <hr>
</div>